The present invention relates to a data alignment correction apparatus for performing alignment correction of a data structure in order that it is properly formatted for a different computer architecture.
In general, when a data structure such as the structure of C language shown in FIG. 1 is processed by a compiler, a head of a word must be aligned to a halfword or fullword boundary. The resultant structure differs depending on the computer and compiler used. This is because computer architectures relating to memory access differ from one model to another. For this reason, when a C language file is planted from one computer to another, the file cannot be directly used if the architectures of the two computers are different. This problem is posed when, for example, a word in the file is written in a specific structure or a header of a communication protocol is output in a specific structure. Therefore, the file cannot be commonly used, and communication cannot be performed even though the same programming language is used, a user cannot use the file.
Therefore data alignment of the data structures must be performed. Conventionally, alignment correction of a structure has been performed by software processing using a special subroutine. However, in order to perform alignment correction by software, a separate subroutine must be formed for each structure, and it takes a very long time to create the software.